package me.wlz.rest;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import me.wlz.entity.Role;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@RequestMapping("/api/role")
@Api(tags = "角色信息管理-API-接口文档")
public class RoleController {

    @GetMapping("/list")
    @ApiOperation(value = "查询角色列表（Test）", notes = "查询角色的所有数据（Test）")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "id", value = "id号", required = false, dataType = "Long"),
            @ApiImplicitParam(name = "name", value = "名称", required = false, dataType = "String")
    })
    public List<Role> queryList(@RequestParam(value = "id",required = false) Long id,
                               @RequestParam(value = "name",required = false) String name) {
        List<Role> roles = new ArrayList<>();
        Role role = new Role();
        role.setId(22L);
        role.setName("admin（Test）");
        role.setDesc("admin角色（Test）");
        roles.add(role);
        return roles;
    }
}
